This snippet uses the string template's range
function to iterate over either .Fields
or .Tags
printing both key and value
# Fields
var s = '{{ range $k, $v := .Fields}} {{$k}}={{$}} | {{end}}'
# Tags
var t = '{{ range $k, $v := .Tags}} {{$k}}={{$}} | {{end}}'